<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>客户端2</title>
</head>
<body>
  <script src="http://localhost:3005/socket.io/socket.io.js"></script>

    <script>
      var socket = io('http://localhost:3005');
      socket.on('chat1 message',function(msg){//接收事件为chat1 message的信息
        console.log(msg);

      })
      
    </script>
</body>
</html>